package com.xiaobai.shardingsphere.mapper;

import com.xiaobai.shardingsphere.entity.DistrictVO;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Mapper
public interface DistrictMapper {
    /**
     * 插入数据
     */
    @Insert("INSERT INTO district(district_name,level) VALUES(#{districtName},#{level})")
    void insertDist(DistrictVO districtVO);

    /**
     * 删除数据
     */
    @Delete("delete from district where id = #{id}")
    int deleteDict(@Param("id") Long id);

    /**
     * 查询
     */
    @Select("select * from district order by id asc")
    List<Map<String, Object>> list();
}
